From: Ian Campbell Date: Fri, 3 Dec 2010 09:36:47 +0000 (+0000) Subject: libxc: osdep: convert xc_evtchn_notify() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11059 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=660aa26bec0c544fd5ef50643d87e9d363d79c39;p=xen.git libxc: osdep: convert xc_evtchn_notify() Signed-off-by: Ian Campbell Signed-off-by: Ian Jackson --- diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c index 899a9edae0..ff807e8b5a 100644 --- a/tools/libxc/xc_evtchn.c +++ b/tools/libxc/xc_evtchn.c @@ -82,3 +82,18 @@ int xc_evtchn_fd(xc_evtchn *xce) { return xce->ops->u.evtchn.fd(xce, xce->ops_handle); } + +int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port) +{ + return xce->ops->u.evtchn.notify(xce, xce->ops_handle, port); +} + +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c index d6956ccc85..4ad545a07d 100644 --- a/tools/libxc/xc_linux.c +++ b/tools/libxc/xc_linux.c @@ -365,13 +365,14 @@ static int linux_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h) return (int)h; } -int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port) +static int linux_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port) { + int fd = (int)h; struct ioctl_evtchn_notify notify; notify.port = port; - return ioctl(xce->fd, IOCTL_EVTCHN_NOTIFY, ¬ify); + return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify); } evtchn_port_or_error_t @@ -437,6 +438,7 @@ static struct xc_osdep_ops linux_evtchn_ops = { .u.evtchn = { .fd = &linux_evtchn_fd, + .notify = &linux_evtchn_notify, }, }; diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c index aeda6eab09..30c2f3b529 100644 --- a/tools/libxc/xc_minios.c +++ b/tools/libxc/xc_minios.c @@ -231,7 +231,7 @@ static int minios_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h) return (int)h; } -int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port) +static int minios_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port) { int ret; @@ -403,6 +403,7 @@ static struct xc_osdep_ops minios_evtchn_ops = { .u.evtchn = { .fd = &minios_evtchn_fd, + .notify = &minios_evtchn_notify, }, }; diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c index 2f632fbdb7..5341a27442 100644 --- a/tools/libxc/xc_netbsd.c +++ b/tools/libxc/xc_netbsd.c @@ -215,13 +215,14 @@ static int netbsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h) return (int)h; } -int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port) +static int netbsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port) { + int fd = (int)h; struct ioctl_evtchn_notify notify; notify.port = port; - return ioctl(xce->fd, IOCTL_EVTCHN_NOTIFY, ¬ify); + return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify); } evtchn_port_or_error_t @@ -301,7 +302,8 @@ static struct xc_osdep_ops netbsd_evtchn_ops = { .close = &netbsd_evtchn_close, .u.evtchn = { - .fd = &netbsd_evtchn_fd, + .fd = &netbsd_evtchn_fd, + .notify = &netbsd_evtchn_notify, }, }; diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c index 506319b7ff..edca1871be 100644 --- a/tools/libxc/xc_solaris.c +++ b/tools/libxc/xc_solaris.c @@ -207,13 +207,14 @@ static int solaris_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h) return (int)h; } -int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port) +static int solaris_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port) { + int fd = (int)h; struct ioctl_evtchn_notify notify; notify.port = port; - return ioctl(xce->fd, IOCTL_EVTCHN_NOTIFY, ¬ify); + return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify); } evtchn_port_or_error_t @@ -279,6 +280,7 @@ static struct xc_osdep_ops solaris_evtchn_ops = { .u.evtchn = { .fd = &solaris_evtchn_fd, + .notify = &solaris_evtchn_notify, }, }; diff --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/xenctrlosdep.h index 8607ad8f80..6bf2d9ccde 100644 --- a/tools/libxc/xenctrlosdep.h +++ b/tools/libxc/xenctrlosdep.h @@ -76,6 +76,8 @@ struct xc_osdep_ops } privcmd; struct { int (*fd)(xc_evtchn *xce, xc_osdep_handle h); + + int (*notify)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port); } evtchn; } u; };